package com.esri.core.tasks.geocode;

/* loaded from: classes.dex */
class GeocodeException extends RuntimeException {
    private static final String cannot_read_address = "Cannot read address.";
    private static final String file_not_found = "File not found.";
    private static final String geocoder_creation = "Locator creation.";
    private static final String internal_error = "Internal error.";
    private static final String intersections_not_supported = "Intersections not supported.";
    private static final String invalid_locator_properties = "Invalid locator properties.";
    private static final String required_field_missing = "Required field missing.";
    private static final String reverse_geocoding_not_supported = "Locator does not support reverse geocoding.";
    private static final long serialVersionUID = 1;
    private static final String uninitialized_geocode_task = "Uninitialized locator.";
    private static final String unsupported_file_format = "Unsupported file format.";
    private static final String unsupported_projection_transformation = "Unsupported projection transformation.";
    private static final String unsupported_spatial_reference = "Unsupported spatial reference.";
    private String mMessage;
    private Reason mReason;

    GeocodeException(int i) {
        this.mMessage = "";
        this.mReason = null;
        Reason fromInteger = Reason.fromInteger(i);
        this.mReason = fromInteger;
        if (fromInteger != null) {
            this.mMessage = getErrorString(fromInteger);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public GeocodeException(Reason reason) {
        this.mMessage = "";
        this.mReason = null;
        this.mReason = reason;
        if (reason != null) {
            this.mMessage = getErrorString(reason);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public GeocodeException(String str) {
        this.mMessage = "";
        this.mReason = null;
        this.mMessage = str;
    }

    @Override // java.lang.Throwable
    public String getMessage() {
        String str = this.mMessage;
        return str == null ? super.getMessage() : str;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* renamed from: com.esri.core.tasks.geocode.GeocodeException$1  reason: invalid class name */
    /* loaded from: classes.dex */
    public static /* synthetic */ class AnonymousClass1 {
        static final /* synthetic */ int[] $SwitchMap$com$esri$core$tasks$geocode$Reason;

        static {
            int[] iArr = new int[Reason.values().length];
            $SwitchMap$com$esri$core$tasks$geocode$Reason = iArr;
            try {
                iArr[Reason.FILE_NOT_FOUND.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                $SwitchMap$com$esri$core$tasks$geocode$Reason[Reason.UNSUPPORTED_FILE_FORMAT.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                $SwitchMap$com$esri$core$tasks$geocode$Reason[Reason.UNSUPPORTED_SPATIAL_REFERENCE.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                $SwitchMap$com$esri$core$tasks$geocode$Reason[Reason.UNSUPPORTED_PROJECTION_TRANSFORMATION.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                $SwitchMap$com$esri$core$tasks$geocode$Reason[Reason.GEOCODER_CREATION.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                $SwitchMap$com$esri$core$tasks$geocode$Reason[Reason.INTERSECTIONS_NOT_SUPPORTED.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                $SwitchMap$com$esri$core$tasks$geocode$Reason[Reason.UNINITIALIZED_GEOCODE_TASK.ordinal()] = 7;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                $SwitchMap$com$esri$core$tasks$geocode$Reason[Reason.INVALID_LOCATOR_PROPERITES.ordinal()] = 8;
            } catch (NoSuchFieldError unused8) {
            }
            try {
                $SwitchMap$com$esri$core$tasks$geocode$Reason[Reason.REQUIRED_FIELD_MISSING.ordinal()] = 9;
            } catch (NoSuchFieldError unused9) {
            }
            try {
                $SwitchMap$com$esri$core$tasks$geocode$Reason[Reason.CANNOT_READ_ADDRESS.ordinal()] = 10;
            } catch (NoSuchFieldError unused10) {
            }
            try {
                $SwitchMap$com$esri$core$tasks$geocode$Reason[Reason.REVERSE_GEOCODING_NOT_SUPPORTED.ordinal()] = 11;
            } catch (NoSuchFieldError unused11) {
            }
            try {
                $SwitchMap$com$esri$core$tasks$geocode$Reason[Reason.INTERNAL_ERROR.ordinal()] = 12;
            } catch (NoSuchFieldError unused12) {
            }
        }
    }

    private String getErrorString(Reason reason) {
        switch (AnonymousClass1.$SwitchMap$com$esri$core$tasks$geocode$Reason[reason.ordinal()]) {
            case 1:
                return file_not_found;
            case 2:
                return unsupported_file_format;
            case 3:
                return unsupported_spatial_reference;
            case 4:
                return unsupported_projection_transformation;
            case 5:
                return geocoder_creation;
            case 6:
                return intersections_not_supported;
            case 7:
                return uninitialized_geocode_task;
            case 8:
                return invalid_locator_properties;
            case 9:
                return required_field_missing;
            case 10:
                return cannot_read_address;
            case 11:
                return reverse_geocoding_not_supported;
            default:
                return internal_error;
        }
    }
}
